// VisualsDlg.cpp : implementation file
//

#include "stdafx.h"
#include "test.h"
#include "VisualsDlg.h"
#include "VisualName.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CVisualsDlg dialog


CVisualsDlg::CVisualsDlg(std::deque<VisualName> & list,CWnd* pParent /*=NULL*/)
: CDialog(CVisualsDlg::IDD, pParent),visuals(list)
{
	//{{AFX_DATA_INIT(CVisualsDlg)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
}


void CVisualsDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CVisualsDlg)
		// NOTE: the ClassWizard will add DDX and DDV calls here
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CVisualsDlg, CDialog)
	//{{AFX_MSG_MAP(CVisualsDlg)
	ON_CBN_SELCHANGE(IDC_COMBO1, OnSelchangeCombo1)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CVisualsDlg message handlers

void CVisualsDlg::OnSelchangeCombo1() 
{

	CComboBox * combo= (CComboBox *)GetDlgItem(IDC_COMBO1);
	selected=combo->GetCurSel();	
}

BOOL CVisualsDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();

//	char numero[10];
	
	CComboBox * combo= (CComboBox *)GetDlgItem(IDC_COMBO1);
	for(int i=0;i<visuals.size();i++){
//		itoa(visuals[i]->ID,numero,10);
		combo->AddString(CString("Visual ")+visuals[i].name/*CString(numero)*/);
	}

	
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}
